Skip to content

validations: add 'x-kubernetes-validations' validation - #60

Open
LoginovIlia wants to merge 1 commit into
kubernetes-sigs:mainfrom
LoginovIlia:xvalidations-validation
Open

validations: add 'x-kubernetes-validations' validation#60
LoginovIlia wants to merge 1 commit into
kubernetes-sigs:mainfrom
LoginovIlia:xvalidations-validation

Conversation

@LoginovIlia

Copy link
Copy Markdown
Contributor

What this PR does:

I added validation for XValidations based on the issue, because I thought it was important for this repository.

I tried to make the algorithm as simple to read as possible, but it is still not completely clear because I compare structs that do not have a unique field. That is why I build a similar structure in toValidationRule with JSON. I need to sort it before comparing, and this also helps me return more readable error messages.

Because this is a slice of structs, I added very flexible configuration. I also moved the config checker into the global test package because we can use it in tests for other validators too.

Which issue this PR is related to:

Fixes #50

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LoginovIlia
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 25, 2026

@everettraven everettraven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the long delay for this review. I've not had much time to dedicate to maintaining this project recently.

Thank you for the contribution and your patience.

Comment thread docs/validations.md Outdated
Comment thread pkg/validations/property/xvalidations.go Outdated
Comment thread pkg/validations/property/xvalidations.go Outdated
Comment thread pkg/validations/property/xvalidations.go Outdated
Comment thread pkg/validations/property/xvalidations.go Outdated
Comment thread pkg/validations/property/xvalidations.go Outdated
Comment thread pkg/validations/property/xvalidations.go Outdated
Comment thread pkg/validations/property/xvalidations.go Outdated
Comment thread pkg/validations/property/xvalidations.go Outdated
@LoginovIlia
LoginovIlia force-pushed the xvalidations-validation branch 2 times, most recently from db0bde2 to 91427be Compare May 20, 2026 21:00
@LoginovIlia

Copy link
Copy Markdown
Contributor Author

@everettraven All fixed

Comment thread pkg/validations/property/xvalidations.go Outdated
Comment thread pkg/validations/property/xvalidations.go
Comment thread pkg/validations/property/util.go Outdated
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@LoginovIlia
LoginovIlia force-pushed the xvalidations-validation branch from 91427be to 7ab9194 Compare July 25, 2026 15:32
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LoginovIlia
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2026
@LoginovIlia
LoginovIlia force-pushed the xvalidations-validation branch from 7ab9194 to 2d43434 Compare July 25, 2026 15:37
@LoginovIlia

Copy link
Copy Markdown
Contributor Author

@everettraven Could you please review it again? I've fixed everything we discussed previously.

@LoginovIlia
LoginovIlia requested a review from everettraven July 28, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support XValidations (CEL validation rules) changes in CRD upgrade safety checks

3 participants